<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>

    <script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.min.js"></script>
    <script src="resource/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="resource/css/bootstrap.min.css">
    <script src="sms/bmob-min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.js"></script>

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
        }

        .head-logo {
            height: 140px;
        }

        .head-inner {
            position: relative;
            width: 1000px;
            height: 140px;
            margin: 0 auto;
        }

        .header-logo {
            position: absolute;
            left: 0;
            top: 0;
            margin: 30px;
        }

        .header-search {
            width: 340px;
            height: 32px;
            border: none;
            float: right;
            margin-top: 53px;
            display: inline;
        }

        .search-form {
            position: relative;
            width: 310px;
            height: 32px;
            border-radius: 3px;
            border: 1px solid black;
        }

        .header-search-input {
            padding: 2px 15px;
            width: 233px;
            height: 28px;
            line-height: 30px;
            font-size: 14px;
            color: #333;
            border: none;
            outline: none;
            border-radius: 3px;
            display: inline-block;
        }

        .header-search-button {
            position: absolute;
            top: 0;
            right: 0;
            width: 47px;
            height: 24px;
            padding-top: 8px;
            text-align: center;
            display: inline-block;
        }

        .header-search-icon {
            width: 17px;
            height: 17px;
            background-image: url("img/search.png");
            display: inline-block;

        }

        .c-body {
            background: skyblue no-repeat top center;
        }

        .c-content {
            margin-right: auto;
            margin-left: auto;
            padding: 80px 20px;
            min-height: 550px;
            width: 1000px;
        }

        .c-summer {
            width: 500px;
            float: left;
        }

        .c-login-panel {
            width: 360px;
            border-radius: 2px;
            background-color: #fff;
        }

        .f-right {
            float: right;
        }

        .tab {
            border-bottom: 1px solid #e0e0e0;
            font-size: 0;
        }

        .c-tab-nav-item {
            color: #a0a0a0;
            display: inline-block;
            width: 180px;
            text-align: center;
            font-size: 17px;
            font-weight: 500;
            line-height: 50px;
            overflow: hidden;
            padding: 10px;
            cursor: pointer;
        }

        .c-tab-nav-item:hover {
            color: #2f5e8d;
        }

        .select {
            color: #2f5e8d;
            font-weight: 700;
        }

        .form {
            margin-top: 25px;
            margin-left: auto;
            margin-right: auto;
            width: 260px;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .c-register {
            float: right;
            margin-top: 7px;
            color: #f6007d;
        }

        .c-input {
            width: 100%;
            height: 40px;
        }

        .c-input-v {
            float: left;
            width: 120px;
            height: 40px;
        }

        .c-other-item {
            margin: 0 7px;
        }

        .btn-login {
            width: 260px;
            height: 40px;
            margin: 30px auto;
        }

        .btn-v {
            float: right;
            width: 120px;
            height: 40px;
            color: #f6007d;
        }

        .margin-bottom {
            margin-bottom: 30px;
        }

        .alert-wrong {
            background-color: #f2dddd;
            color: #853838;
            padding: 10px;
            text-align: center;
        }
    </style>

</head>
<body>
<div class="head-logo">
    <div class="head-inner">
        <!--logo-->
        <div class="header-logo">
            <a href="index.html"><img src="img/logo_deepblue.png" alt="乐鲜生活" height="80"/></a>
        </div>
        <div class="header-search">
            <!--搜索框-->
            <div class="search-form">
                <input type="text" name="search-content" class="header-search-input" maxlength="100" placeholder="搜一哈你想搜的内容"  />
                <a href="searchResult.html" class="header-search-button">
                    <span class="header-search-icon"></span>
                </a>
            </div>
        </div>
    </div>
</div>
<div class="c-body" id="app-login">
    <div class="c-content">
        <div class="c-summer">
            <img src="img/summer.jpg" alt="LeGo">
        </div>
        <div class="c-login-panel f-right" id="passwordLogin">
            <div class="tab">
                <div class="c-tab-nav-item select">密码登录</div>
                <div class="c-tab-nav-item" onclick="clickDiv1()">验证码登录</div>
            </div>
            <div class="alert-wrong" v-show="showAlert">{{ alert_p }}</div>
            <div class="form">
                <div class="form-horizontal">
                    <div class="form-group input-group">
                        <span class="input-group-addon" id="user"><img src="img/user.png" alt="tel"></span>
                        <input type="tel" class="form-control c-input" v-model="phone" placeholder="手机号" aria-describedby="user" maxlength="11" @change="checkPhone_P">
                    </div>
                    <div class="form-group input-group">
                        <span class="input-group-addon" id="pwd"><img src="img/pwd.png" alt="pwd"></span>
                        <input type="password" class="form-control c-input" v-model="password" placeholder="密码" aria-describedby="pwd">
                    </div>
                    <div class="c-other-item">
                        <div class="checkbox pull-left">
                            <label>
                                <input type="checkbox" v-model="rememberPwd"> 记住密码
                            </label>
                        </div>
                        <a href="register.html" class="c-register">免费注册</a>
                    </div>
                    <button class="btn btn-primary btn-login" id="btn_login" @click="login_p">登录</button>
                </div>
            </div>
        </div>
        <div class="c-login-panel f-right hide" id="smsLogin">
            <div class="tab">
                <div class="c-tab-nav-item" onclick="clickDiv2()">密码登录</div>
                <div class="c-tab-nav-item select">验证码登录</div>
            </div>
            <div class="alert-wrong" v-show="showAlert_vft">{{ alert_vft }}</div>
            <div class="form">
                <div class="form-horizontal">
                    <input type="tel" class="form-control c-input margin-bottom" v-model="phone_vft" placeholder="手机号" maxlength="11" @change="checkPhone_S">
                    <div>
                        <input type="tel" class="form-control c-input-v" v-model="vft_sms" placeholder="短信验证码" maxlength="6" @change="checkVer">
                        <button type="button" class="btn btn-default btn-v" id="btnSMS" @click="getSMSCode">{{ btn_vft }}</button>
                    </div>
                    <button class="btn btn-primary btn-login" @click="login_sms">登录</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="./js/login.js"></script>

<!--切换登录方式-->
<script>
    var t1 = document.getElementById("passwordLogin");
    var t2 = document.getElementById("smsLogin");
    function clickDiv1(){
        t1.classList.add("hide");
        t2.classList.remove("hide");
    }
    function clickDiv2(){
        t2.classList.add("hide");
        t1.classList.remove("hide");
    }
</script>
</body>
</html>